/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface BasBarM extends BasicModel<BasBarM> {
  pkgId?: string; // 包装Id
  cbeach?: string; // 批次号
  invCode?: string; // 存货编码
  boxType?: string; // 条码类型
  iqty?: number; // 数量
  createByName?: string; // 创建人名称
  basBarRdsList?: any[]; // 子表列表
}

export const basBarMList = (params?: BasBarM | any) =>
  defHttp.get<BasBarM>({ url: adminPath + '/barcode/basBarM/list', params });

export const basBarMListData = (params?: BasBarM | any) =>
  defHttp.post<Page<BasBarM>>({ url: adminPath + '/barcode/basBarM/listData', params });

export const basBarMForm = (params?: BasBarM | any) =>
  defHttp.get<BasBarM>({ url: adminPath + '/barcode/basBarM/form', params });

export const basBarMSave = (params?: any, data?: BasBarM | any) =>
  defHttp.postJson<BasBarM>({ url: adminPath + '/barcode/basBarM/save', params, data });

export const basBarMDelete = (params?: BasBarM | any) =>
  defHttp.get<BasBarM>({ url: adminPath + '/barcode/basBarM/delete', params });

///barcode/basBarM/genSnCode
export const basBarMGenSnCode = (params?: any, data?: BasBarM | any) =>
  defHttp.postJson<BasBarM>({ url: adminPath + '/barcode/basBarM/genSnCode', params, data });

export const basBarMbasBarRdsListData = (params?: any) =>
  defHttp.get<BasBarM>({ url: adminPath + '/barcode/basBarM/basBarRdsListData', params });

export const basBarMbasBarGetConfig = (params?: any) =>
  defHttp.get<BasBarM>({ url: '/barcode/getConfig', params });